<?php
header('Content-Type: text/xml');
?> 
<?php 

include("../db/opendb.php");

include("functions.php");

/*$query1 = "select AVG(Price_Per_SQFT) as avg from Game_Data where City = 'San Francisco' and Property_Type = 'RESI' and Selling_Date >= DATE_SUB(now(), INTERVAL 3 month);";
$result1 = mysql_query($query1) or die ("SQL Error".mysql_error());
$row1 = mysql_fetch_assoc($result1);*/
//echo $row1['avg'];

$query = "Select * from Blog_Article_Categories group by Category";

$result = mysql_query($query) or die ("SQL Error".mysql_error());

$xml = "<blogs>";

while ($row = mysql_fetch_assoc($result))
{
	$xml .= "<cat>";
	$xml .= "<name><![CDATA[".$row['Category']."]]></name>";
	$xml .= "<feed_id><![CDATA[".$row['Blog_Feed_ID']."]]></feed_id>";
	$xml .= "<art_id><![CDATA[".$row['Article_ID']."]]></art_id>";
	$xml .= "</cat>";
}
$xml .= "</blogs>";

echo $xml;

?>
